// 1. 引入vue-router
import VueRouter from 'vue-router'
// 2. 注册
import Vue from 'vue'
Vue.use(VueRouter)
// 3. 初始化
const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: () => import('../views/login/login.vue')
    },
    {
      path: '/',
      component: () => import('../views/layout/layout.vue'),
      children: [
        {
          path: '/',
          component: () => import('../views/home/home.vue')
        },
        {
          path: '/article',
          component: () => import('../views/article/article.vue')
        },
        {
          path: '/publish',
          component: () => import('../views/publish/publish.vue')
        }
      ]
    }
  ] // 路由规则
})
// 4. 导出路由实例
export default router
